<nav class="navbar navbar-default" role="navigation">
    <div class="container">

        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">技术论坛</a>
        </div>

        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                {% if not article_type_id %}
                    <li class="active"><a href="/">全部</a></li>
                    {% else %}
                    <li><a href="/">全部</a></li>
                {% endif %}
                {% for item in article_type_list %}
                    {% if item.0 == article_type_id %}
                        <li class="active"><a href="/all/{{ item.0 }}.html">{{ item.1 }}</a></li>
                    {% else %}
                        <li><a href="/all/{{ item.0 }}.html">{{ item.1 }}</a></li>
                    {% endif %}
                {% endfor %}
            </ul>

            <ul class="nav navbar-nav navbar-right ">
                {% if request.session.user_info %}
                    <li>
                        <a href="/backend/index.html">{{ request.session.user_info.nickname }}</a>
                    </li>
                    {% if  request.session.user_info.blog__site %}
                        <li><a style="padding-left: 0;padding-right: 0;">·</a></li>
                        <li>
                            <a href="/{{ request.session.user_info.blog__site }}.html">我的博客</a>
                        </li>
                    {% endif %}
                    <li><a style="padding-left: 0;padding-right: 0;">·</a></li>
                    <li><a href="/backend/index.html">管理</a></li>
                    <li><a style="padding-left: 0;padding-right: 0;">|</a></li>
                    <li><a href="/logout.html">退出</a></li>
                {% else %}
                    <li><a href="/login.html">登陆</a></li>
                    <li><a href="/register.html">注册</a></li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav>